package com.openbravo.data.loader;

import com.openbravo.basic.BasicException;

public class SequenceForMySQL extends BaseSentence
{
  private BaseSentence sent1;
  private BaseSentence sent2;

  public SequenceForMySQL(Session paramSession, String paramString)
  {
    this.sent1 = new StaticSentence(paramSession, "UPDATE " + paramString + " SET ID = LAST_INSERT_ID(ID + 1)");
    this.sent2 = new StaticSentence(paramSession, "SELECT LAST_INSERT_ID()", null, SerializerReadInteger.INSTANCE);
  }

  public DataResultSet openExec(Object paramObject)
    throws BasicException
  {
    this.sent1.exec();
    return this.sent2.openExec(null);
  }

  public DataResultSet moreResults()
    throws BasicException
  {
    return this.sent2.moreResults();
  }

  public void closeExec()
    throws BasicException
  {
    this.sent2.closeExec();
  }
}

/* Location:           D:\PowerFulPOS-2.30.2\openbravopos.jar
 * Qualified Name:     com.openbravo.data.loader.SequenceForMySQL
 * JD-Core Version:    0.6.0
 */